package com.muyu.system.danmo.fegin;

import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.system.danmo.dto.CloseDTO;
import com.muyu.system.danmo.dto.PayDTO;
import com.muyu.system.danmo.dto.RefundDTO;
import com.muyu.system.danmo.vo.PayVO;
import com.muyu.system.danmo.vo.RefundResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

/**
 * @author Administrator
 */
@FeignClient(
        contextId = "PayFeign01",
        value = ServiceNameConstants.PAY_SERVICE,
        path = "/open/api"
)
public interface PayFeign {

    /**
     * 支付
     * @param payDTO
     * @return
     */
    @PostMapping("/pay")
    Result<PayVO> pay(@RequestBody PayDTO payDTO);

    /**
     * 退款
     * @param refundDTO
     * @return
     */
    @PostMapping("/refund")
    Result<RefundResultVO> refund(@RequestBody RefundDTO refundDTO);

    /**
     * 关闭订单
     * @param closeDTO
     * @return
     */
    @PostMapping("/close")
    Result<String> close(@RequestBody CloseDTO closeDTO);
}
